package com.googlecode.moneyManager.model;

import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Embedded;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.PrimaryKeyJoinColumn;

/**
 * 
 * @author Sergiy Doroshenko
 * 
 */
@Entity
public class Bank extends BaseEntity {
    private String name;
    private List<Branch> branch;
    private Address address;

    public Bank(){}
    
    public String getName() {
	return name;
    }

    public void setName(String name) {
	this.name = name;
    }
    @Embedded
    public Address getAddress() {
	return address;
    }

    public void setAddress(Address address) {
	this.address = address;
    }
    @OneToMany(fetch = FetchType.LAZY, cascade = { CascadeType.ALL }, mappedBy = "bank")
    public List<Branch> getBranch() {
        return branch;
    }

    public void setBranch(List<Branch> branch) {
        this.branch = branch;
    }

}
